You can set up your AI Agent to interact with users through Facebook Messenger. This section explains how to create a Facebook app on the Facebook for Developers portal and connect it to your AI Agent in the Druid Portal.
Prerequisites
Before integrating your AI Agent with Facebook, ensure you have set up the required accounts, assets, and network rules based on your deployment type.
Accounts & Permissions
- Facebook page: You have administrative access to one or more Facebook Pages.
AI Agent Setup & Data
- Published AI Agent: An active, published AI Agent built within the Druid Portal.
- Facebook page ID: Locate your Facebook page ID and write it down as you will need it to activate the Instagram channel in the Druid Portal:
- Open the Facebook page in a browser.
- Check the browser address bar:
Network Configuration (On-Premises Deployments Only)
If running Druid on-premises, ensure your firewall permits traffic to and from the following endpoints:
| Outbound | graph.facebook.com |
| Inbound | Druid.BotApp |
Integration procedure
Connect an AI Agent to Facebook
To connect an AI Agent with Facebook Messenger, follow these steps:
Step 1. Create a Facebook app
- In your browser, navigate to Facebook for Developers and log in.
- On the toolbar, click My Apps. Your Apps page appears.
- Click the Create App button.
- Enter an App name and App contact email. Meta uses this email address to send important updates about your application. By default, this field pre-fills with the email address linked to your Meta developer account, but you can change it if needed.
- Click Next.
- Filter use cases by Business messaging and select Engage with customers on Messenger from Meta.
- Click Next.
- Select your business portfolio.
- Click Next.
- If no publishing requirements are identified, click Next; otherwise, follow the on screen instructions.
- In the Overview step, click Create app.
- After the app creation process completes, the App Dashboard appears.
The Create an app wizard appears.
Step 2. Set up Messenger for your app
In this section you will enable Messenger. connect your app to a Facebook Page and generate an access token for the FB page:
- On the Add Products to Your App page, search for Messenger and click the Set Up button. The Messenger API Setup appears.
- Scroll-down to the Generate access tokens section and click Connect.
- Continue as logged in user or log in using another account.
- Select the target Facebook page and click Continue.
- When prompted to review the app's permission requests, click Save.
- Click Got it.
- Click the Generate button to generate an access token for your FB page. The Token Generation pop-up appears.
-
Tick I understand, then click the Copy button to copy the page access token and save it for use at Step 4.
- Click Done.
A pop-up appears informing you that you linked your Facebook app to Facebook.
The connected Facebook page appears on the Messenger API Setup.
Step 3. Get Facebook app details
Get these Facebook app details as you will need them to configure the Instagram channel in the Druid Portal:
- On the menu, go to App settings > Basic.
- Click the Show button next to the App secret.
- Enter the password associated to your Facebook account and click Confirm twice. The App secret is showed in the field.
- Copy the App secret and the App ID and keep them in a safe location as you will need these details later to configure the channel in the Druid Portal.
- Find out the API version of your app. Go to the App settings > Advancedand check what the API version is.
Continue the integration setup following subsequent steps.
Step 4. Customize your app
This section describes how to customize your app:
- Go to app Dashboard and click Customize the Engage with customers on Messenger from Meta use case.
- The Permissions and features list appears. The basic permissions required for testing are already selected. You can add additional ones as per your needs.
Continue with generating Facebook page access token.
Step 5. Generate Facebook Page access token
To generate a Facebook page access token:
- On the app customization menu, click Messenger API Settings.
- Under section 2. Generate access tokens, click Connect.
- Confirm that you want to continue with the Facebook account (the one with administrative access to the Facebook page) or log in using another account.
- Select the target Facebook Pages for app access and click Continue.
- Review app access and click Save.
- Wait until you get confirmation that your Facebook account has been connected to the app, then click Got it. The pop-up closes and the Facebook page(s) appear under section 2. Generate access tokens.
- Click Generate.
- Select I understand, then copy the token and keep it in a safe location as you will need it to configure the channel in the Druid Portal.
- Click Done to close the modal.
- Click Add Subscriptions.
- Select messages and messaging_postbacks. Select messaging_customer_information if you want Druid to store the user's first name and last name (in [[ChatUser]].FirstName and [[ChatUser]].Lastname).
- Click Confirm.
You can now configure the channel in the Druid Portal.
Step 6: Activate the Facebook channel in the Druid Portal
- In the Druid Portal go to your AI Agent settings.
- Click the Channels tab, then click the Facebook card.
- Enter the Facebook App ID and the Facebook App Secret. Use the App ID and App Secret you copied when creating the Facebook app.
- Click the Add Page button and enter the Facebook Page ID and Page Access Token and click Pave Page button.
- Copy the Callback URL and Verify Token and save them in a safe location as you will need them to configure the Facebook app webhooks.
- Optionally, customize channel display settings as follows:
- Alias: Enter a clear, business-friendly display name (e.g., Interactive Messaging). This value is stored in[[ChatUser]].ChannelDisplayName, which appears in reporting tools like AI Agent Summary dashboard - Engagement KPIs and can also be referenced in flow business logic.
- Description: Enter a brief description. This is particularly helpful when using an alias, as it helps identify the channel's specific purpose within the Druid Portal.
- Channel Icon: Upload a custom icon to display on the channel card within the Druid Portal.
- Click Publish to activate the channel. The channel activation might take up to 1 minute.
The channel configuration modal appears.
After the channel activates, the following fields are available in Druid:
- [[ChatUser]].ChannelId = "facebook"
- [[ChatUser]].UserId - Stores an unique identifier of the Facebook user account.
- [[ChatUser]].ChannelDisplayName - Stores the Alias which is used in AI Agent Summary Dashboard > Engagement KPIs > Channel chart.
Step 7: Configure Facebook app webhooks
In order to send messages and other events from your AI Agent to Facebook Messenger, you must enable webhooks:
- Go to the web page with your Facebook app configuration.
- Under section 1. Configure webhooks, enter the Callback URL and Verify Token you copied from the Druid Portal when activating the channel.
- Click Verify and save. The web page refreshes and the customization page appears on Permissions and features.
- On the app customization menu, click Messenger API Settings.
- Expand section 1. Configure webhooks.
- Subscribe to the following events: messages, messaging_postbacks, messaging_handoverand messaging_optins.
- Collapse the section and expand section 2. Generate access tokens.
- Click Add Subscriptions displayed in line with the Facebook page for which you want to activate the webhook events.
- In the modal, select the following events: messages, messaging_postbacks, messaging_handoverand messaging_optins. Select messaging_customer_information if you want Druid to store the chat user's first name and last name (in [[ChatUser]].FirstName and [[ChatUser]].Lastname).
- Click Confirm.
- Close the pop-up. The selected webhook fields appear in the section.
The integration between the AI Agent and the Facebook Page is complete.
Step 8. For testing purposes, add Tester role (Optional)
While your Facebook app is in Development roles, you can test the integration directly in Instagram only by using an account who has been granted the Tester role.
Before testing the integration from Instagram, assign the Instagram Tester role to a Facebook test account:
- In the main menu, go to App roles > Roles.
- Click Add People.
- Select Tester and enter the Email / username / Facebook ID of a Facebook account that has been linked to an Instagram account (ensure you have access to this account), then click Add.
- Open Facebook in a web browser and log into your account.
- Click your profile picture icon in the top-right corner and select your personal profile.
- Look at the address bar at the top of your browser:
- If the URL displays a username: Copy the text after facebook.com/ (e.g., facebook.com/john.doe).
- If the URL displays a numeric ID: Copy the number after id= (e.g., facebook.com/profile.php?id=1000123456789).
- To accept the pending invite:
- Open Facebook in a web browser and log into your test account.
- Check the Notifications bell icon, click on the invite request notification and accept the invite.
- Close Facebook web page.
- Return to the Meta Developer Portal and refresh the Roles page. The status of the Tester account is no longer Pending.
To get the Facebook ID:
Once added, the account status will show as Pending.
You can now test the Facebook integration.
Test the Instagram Integration
- Log into Facebook using the personal / tester account you authorized at Step 8.
- Search for your the Facebook page.
- Send a direct message.
The AI Agent will reply with the message set on the Welcome flow.
Publish the Facebook App (Switch from Development to Live Mode)
When your app is in Development mode, only designated Testers can message your AI Agent. To allow any public Instagram user to send direct messages to your AI Agent, you must publish your app.
Prerequisites before requesting app review
Before submitting your app for review or toggling to Live mode, ensure the following basic app configuration is complete in the Meta Developer Portal:
- Privacy Policy URL. Go to App Settings > Basic and enter a valid, publicly accessible Privacy Policy link.
- Data Deletion Instructions. In App Settings > Basic, provide a Data Deletion Callback URL or clear instructions page.
- App Icon & Category. Add a square app icon ($1024 \times 1024$ px) and choose a category under Basic Settings.
- Business Verification. Go to Verification (or Meta Business Suite) to complete Business Verification for your organization. Meta requires this for apps requesting advanced messaging capabilities.
Official Meta developer documentation references
For further details and direct guidance from Meta, refer to these official resources:
-
Meta App Review Overview. Guides on preparing, submitting permissions, and meeting policy criteria.
-
App Modes & Roles Guide. Explains differences between Development and Live modes, access restrictions, and tester limits.
-
Permissions & Features Reference. Direct specification details for instagram_manage_messages and related platform permissions.
-
Meta Business Verification Docs. Instructions for verifying your Business Manager profile in Meta Business Suite.
Complete your Facebook app review, make the app public and publish the Facebook Page.
Handle Facebook Data Deletion Requests
To comply with Meta data privacy requirements, Druid supports an automated Facebook data deletion flow. When a user who has interacted with an AI Agent via the Facebook channel deletes their Facebook account or removes the app, Facebook sends a data deletion notification to Druid. You can configure a specific flow to handle these requests, such as anonymizing personal information or deleting records from the Conversation History.
To enable this functionality, you must create a data deletion handling flow select it from the Facebook data deletion flow dropdown in the Dialogue Management section of your AI Agent settings. For more information, see Facebook Data Deletion Flow.
Inactivate the channel
To inactivate the channel, go to the Channels page and turn off the Enabled toggle on the Facebook card.
Limitations
- The Facebook channel has a limitation on file transfer, it only supports common media files (images or video). Other file formats like .doc, .docx, .txt or .xslx (etc.) will be altered and corrupted both on file upload or when generated by AI Agents.







































